]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
fileUtils: Remove some compatibility code
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 7 Mar 2020 18:28:48 +0000 (19:28 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 9 Mar 2020 13:18:48 +0000 (13:18 +0000)
The condition was added to keep working with the then-stable version
of gjs. We already require a more recent version now, so the compat
code is effectively dead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1077

js/misc/fileUtils.js

index 1abe64c2ea34d1505a9359e746e9476d4e8275c4..e672f68bd4c665f9d9aa624dfaceb09b96ab2479 100644 (file)
@@ -76,19 +76,15 @@ function loadInterfaceXML(iface) {
         _ifaceResource._register();
     }
 
-    let xml = null;
     let uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`;
     let f = Gio.File.new_for_uri(uri);
 
     try {
         let [ok_, bytes] = f.load_contents(null);
-        if (bytes instanceof Uint8Array)
-            xml = imports.byteArray.toString(bytes);
-        else
-            xml = bytes.toString();
+        return imports.byteArray.toString(bytes);
     } catch (e) {
         log(`Failed to load D-Bus interface ${iface}`);
     }
 
-    return xml;
+    return null;
 }